<div>
    <div>
        <h4>已添加规则</h4>
        <div class="button-group">
            <button class="btn btn-default" ng-click="add()">新增</button>
            <button class="btn btn-default" ng-click="modify()" ng-disabled="!isSelected">修改</button>
            <button class="btn btn-default" ng-click="goDel()" ng-disabled="!isSelected">删除</button>
            <button class="btn btn-default" ng-click="goUp()" ng-disabled="!isSelected">上移</button>
            <button class="btn btn-default" ng-click="goDown()" ng-disabled="!isSelected">下移</button>
            <button class="btn btn-default" ng-click="goSonTemplate()">添加子模板</button>
        </div>
        <div class="rule-table">
          <!-- {{rules}} -->
            <table class="table table-bordered table-responsive ">
                <tr>
                    <td>规则名称</td>
                    <td>匹配模式</td>
                    <td>开头</td>
                    <td>结尾</td>
                    <td>最少标签数</td>
                    <td>模糊系数</td>
                    <td>操作</td>
                </tr>
                <tr ng-repeat="r in rules" ng-click="select(r)" ng-class="{true: 'selected', false:'unselected'}[r==selectedItem]">
                    <td>{{r.name}}</td>
                    <td>{{r.type=='1'?'匹配开头':(r.type=='2'?'匹配开头结尾':'匹配全文')}}</td>
                    <td>{{r.beginText}}</td>
                    <td>{{r.endText}}</td>
                    <td>{{r.limit}}</td>
                    <td>{{r.similar}}</td>
                    <td>
                        <div class="radio">
                            <label>
                                <input type="radio" value="keep" ng-model="r.keep">保留
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" value="filtrate" ng-model="r.keep">过滤
                            </label>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
